package com.ch.clinking.Dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import com.ch.clinking.bean.RememberPassword;

@Dao
public interface RememberPasswordDao {

    @Insert
    void insert(RememberPassword... rememberPasswords);

    @Query("DELETE FROM RememberPassword WHERE account = :account")
    void deleteByAccount(String account);

    @Query("SELECT * FROM RememberPassword WHERE account = :account and remember = 1")
    RememberPassword selectByAccount(String account);

    @Query("SELECT * FROM RememberPassword ORDER BY id DESC LIMIT 1")
    RememberPassword selectLatestUser();

}
